﻿using System.Collections.Generic;
using FollowMe.Model;
using FollowMe.Services.Response;
using FollowMe.Services.View;

namespace FollowMe.Services.Mappers
{
    public static class RegistrationIDExtensionMethods
    {
        public static RegistrationIDView ConvertToRegistrationIDView(this RegistrationID registrationID)
        {
            return new RegistrationIDView
            {
                id = registrationID.ID,
                memberID = registrationID.MemberID,
                regID = registrationID.RegID
            };
        }

        public static IList<RegistrationIDView> ConvertToRegistrationIDViews(this IEnumerable<RegistrationID> registrationIDs)
        {
            IList<RegistrationIDView> registrationIDViews = new List<RegistrationIDView>();
            foreach (RegistrationID registrationID in registrationIDs)
            {
                registrationIDViews.Add(registrationID.ConvertToRegistrationIDView());
            }
            return registrationIDViews;
        }
    }
}